﻿
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace TrackSystem.Entities.Data
{
    /// <summary>
    /// 配置角色实体
    /// </summary>
    public class RoleConfiguration : IEntityTypeConfiguration<IdentityRole>
    {
        public void Configure(EntityTypeBuilder<IdentityRole> builder)
        {
            builder.HasData(
                new IdentityRole
                {
                    Name = "Admin",
                    NormalizedName = "ADMIN",
                },
                new IdentityRole
                {
                    Name = "Eng",
                    NormalizedName = "Engineer"
                },
                new IdentityRole
                {
                    Name = "Op",
                    NormalizedName = "Operator"
                },
                new IdentityRole
                {
                    Name = "Guest",
                    NormalizedName = "Guest"
                },
                new IdentityRole
                {
                    Name = "User",
                    NormalizedName = "User"
                }
            );
        }
    }
}
